﻿using ATEC.GeometryNET;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntityExample
{
    class DrawCircleAndTransform
    {
        public static CurveSet MakeCircle()
        {
            // 圆的数据结构
            XPoint3d center = XPoint3d.FromXYZ(0, 0, 0);                       // 点 
            XEllipse3d ellips = XEllipse3d.FromCenterRadiusXY(center, 10000); // 椭圆
            BasicCurve pBaisc = BasicCurve.CreateArc(ellips);            // 基本曲线
            CurveSet pCv = CurveSet.Create(CurveSet.BoundaryType.Outer); // 曲线集合
            pCv.Add(pBaisc);

            return pCv;
        }

        public static CurveSet TransformCircle(CurveSet cv)
        {
            XPoint3d translation = XPoint3d.FromXYZ(0, 0, 10000); // 平移
            XMatrix3d mat = XMatrix3d.Scale(1.5);          // 缩放
            XTransform3d trs = XTransform3d.FromMatrixAndTranslation(mat, translation);

            CurveSet pCopy = cv.Clone(); // 副本
            pCopy.Transform(trs);   // 平移+缩放
            return pCopy;
        }
    }
}
